﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace SecurityDev
{
    static class CheckText
    {
        public static bool IsValidPhone(string strIn)
        {
            return !Regex.IsMatch(strIn, @"[^0-9+(), ]") && strIn != "";
        }

        public static bool IsValidEmail(string strIn)
        {
            return strIn != "" &&
                Regex.IsMatch(strIn, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$");
        }
    }
}
